package com.htsk.city.services.core.dao;

import com.htsk.city.services.core.domain.CityServiceSubCategory;
import com.htsk.city.services.core.domain.ServiceCategory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ServiceCategoryDao extends JpaRepository<CityServiceSubCategory, Long> {

    @Query(value = "select sc from CityServiceCategory cs left join ServiceCategory sc on cs.serviceCategoryId=sc.id where cs.cityId=?1 and sc.delFlag=0" +
            " and sc.status=1 order by sc.id desc ")
    List<ServiceCategory> queryByCityId(Long cityId);


}
